function PostBack(Month, monthPicker, year_id, date_id)
{
  year=document.getElementById(year_id).innerHTML;
  extern = year + "-";
  if (Month < 10)
    extern += "0";
  extern += Month;
  document.getElementById(date_id).value=extern;
  
  hideMonthPicker(monthPicker);
}

function prev(year_id)
{
  item = document.getElementById(year_id);
  curYear = (new Date).getFullYear();
  
  item.innerHTML = item.innerHTML - 1;
  
  if(item.innerHTML <= 1970)
    item.innerHTML = 1970
}

function next(year_id)
{
  item = document.getElementById(year_id);
  curYear = (new Date).getFullYear();
  item.innerHTML = parseInt(item.innerHTML) + 1;
  if(item.innerHTML >= curYear)
    item.innerHTML = curYear;
}

function showMonthPicker(monthPicker)
{
  document.getElementById(monthPicker).style.display = "block";
}

function hideMonthPicker(monthPicker)
{
  document.getElementById(monthPicker).style.display = "none"
}

function changeMonthPickerDisplay(monthPicker, closeMonthPicker)
{
  if (document.getElementById(monthPicker).style.display == "none")
  {
    document.getElementById(monthPicker).style.display = "block"
  }
  else
  {
    document.getElementById(monthPicker).style.display = "none"
  }
  hideMonthPicker(closeMonthPicker); //make sure to hide other panel
}

function yearNow(year_id)
{
  var d=new Date();
  var yearNow=d.getFullYear();
  document.getElementById(year_id).innerHTML = yearNow;
}
